<!--外委---基桩检测信息---查看 -->
<template>
  <div class="department zj_ment">
    <!-- 左侧部门管理 -->
    <div class="structureTree" v-if="treelength">
      <div class="structureTree_title">
        <div>组织机构</div>
        <div>
          <el-checkbox v-model="checked" @change="see()">查看下级</el-checkbox>
        </div>
      </div>
      <!-- <el-tree :data="treeData" :props="defaultProps" :highlight-current="highlightBd" @node-click="handleNodeClick"
        node-key="fCompanyid" :accordion="true" :expand-on-click-node="false">
                                        </el-tree> -->
      <tree :treeData="treeData" :checkData="checkData" name="engineerList" nodeKey="fCompanyid"
        @getTreeInfo="handleNodeClick" :defaultProps="defaultProps">
      </tree>
    </div>
    <!-- 右侧 -->
    <div class="department_right">
      <!-- 部门信息 -->

      <div class="department_right_name">
        <div>
          {{ name }}
        </div>
      </div>

      <!-- 顶部导航栏 -->
      <div class="mechanism_nav">
        <!-- 左侧 -->
        <div class="mechanism_nav_left"></div>
        <!-- 右侧 -->
        <div class="print">
          <div class="printTable">
            <!--  -->
            <el-button type="primary" icon="el-icon-refresh" size="small" @click="getDataList(getList)">
            </el-button>
            <el-button type="primary" v-if="yj_view" icon="el-icon-search" size="small" @click="editText()">查看
            </el-button>
          </div>
        </div>
      </div>

      <!-- 表格 -->
      <div class="text_table">
        <el-table ref="multipleTable" v-loading="loading" element-loading-text="拼命加载中"
          element-loading-spinner="el-icon-loading" element-loading-background="rgba(0, 0, 0, 0.2)"
          @row-click="getRowInfo($event, '0')" :data="tableData" style="width: 100%" height="100%" stripe border
          highlight-current-row @current-change="rowChange">
          <el-table-column fixed type="index" label="序号" width="50" align="center">
          </el-table-column>
          <el-table-column prop="F_ProjectName" label="项目名称">
            <!-- 超出鼠标滑过显示 -->
            <template slot-scope="scope">
              <div class="lineBoxhidden">
                <a href="javascript:;" :title="scope.row.F_ProjectName">{{
                  scope.row.F_ProjectName
                }}</a>
              </div>
            </template>
          </el-table-column>
          <el-table-column prop="F_CompanyName" label="施工单位">
            <template slot-scope="scope">
              <div class="lineBoxhidden">
                <a href="javascript:;" :title="scope.row.F_CompanyName">{{
                  scope.row.F_CompanyName
                }}</a>
              </div>
            </template>
          </el-table-column>
          <el-table-column prop="F_EngineeringName" label="工程名称">
            <template slot-scope="scope">
              <el-button @click="openDialog('0', scope.row)" @cell-dblclick="openDialog" type="text" size="small"
                style="padding: 0 !important; margin: 0">
                {{ scope.row.F_EngineeringName }}
              </el-button>
            </template>
          </el-table-column>

          <el-table-column prop="F_EngineeringLocation" label="工程地点" width="120" align="center">
            <template slot-scope="scope">
              <div class="lineBoxhidden">
                <a href="javascript:;" :title="scope.row.F_EngineeringLocation">{{ scope.row.F_EngineeringLocation }}</a>
              </div>
            </template>
          </el-table-column>

          <el-table-column prop="inspectionDates" label="报验日期" width="90" align="center">
            <template slot-scope="scope">
              <div class="lineBoxhidden">
                <a href="javascript:;" :title="scope.row.inspectionDates">{{
                  scope.row.inspectionDates
                }}</a>
              </div>
            </template>
          </el-table-column>
          <el-table-column prop="F_ContactsAndTel" label="联系人和电话" align="center">
            <template slot-scope="scope">
              <div class="lineBoxhidden">
                <a href="javascript:;" :title="scope.row.F_ContactsAndTel">{{
                  scope.row.F_ContactsAndTel
                }}</a>
              </div>
            </template>
          </el-table-column>
          <el-table-column prop="fFactoryname" label="检测项目" width="120">
            <template slot-scope="scope">
              <div class="lineBoxhidden">
                <a href="javascript:;" :title="scope.row.F_CheckContent">{{
                  scope.row.F_CheckContent
                }}</a>
              </div>
            </template>
          </el-table-column>
          <el-table-column prop="F_CheckerNames" label="检测人员" align="center">
            <template slot-scope="scope">
              <div class="lineBoxhidden">
                <a href="javascript:;" :title="scope.row.F_CheckerNames">{{
                  scope.row.F_CheckerNames
                }}</a>
              </div>
            </template>
          </el-table-column>
          <el-table-column prop="F_CheckFoundationCount" label="检测数量" width="70" align="center">
            <template slot-scope="scope">
              <div class="lineBoxhidden">
                <a href="javascript:;" :title="scope.row.F_CheckFoundationCount">{{ scope.row.F_CheckFoundationCount
                }}</a>
              </div>
            </template>
          </el-table-column>

          <el-table-column prop="FirstClasscount" label="I类" width="50" align="center">
            <template slot-scope="scope">
              <div class="lineBoxhidden">
                <a href="javascript:;" :title="scope.row.FirstClasscount">{{
                  scope.row.FirstClasscount
                }}</a>
              </div>
            </template>
          </el-table-column>
          <el-table-column prop="SecondClasscount" label="II类" width="50" align="center">
            <template slot-scope="scope">
              <div class="lineBoxhidden">
                <a href="javascript:;" :title="scope.row.SecondClasscount">{{
                  scope.row.SecondClasscount
                }}</a>
              </div>
            </template>
          </el-table-column>
          <el-table-column prop="ThirdClasscount" label="III类" width="50" align="center">
            <template slot-scope="scope">
              <div class="lineBoxhidden">
                <a href="javascript:;" :title="scope.row.ThirdClasscount">{{
                  scope.row.ThirdClasscount
                }}</a>
              </div>
            </template>
          </el-table-column>
          <el-table-column prop="FourthClasscount" label="IV类" width="50" align="center">
            <template slot-scope="scope">
              <div class="lineBoxhidden">
                <a href="javascript:;" :title="scope.row.FourthClasscount">{{
                  scope.row.FourthClasscount
                }}</a>
              </div>
            </template>
          </el-table-column>
          <template slot="empty">
            <img style="width: 285px; height: 208px" src="@/assets/img/undata.png" alt="" />
            <div class="pageFlagText">暂时没有数据哦！</div>
          </template>
        </el-table>
      </div>
    </div>
    <!-- 查看 -->
    <div class="Control-1 zj_ment">
      <el-dialog title="查看" v-dialogDrag :visible.sync="dialogTableVisibleText" v-loading="loadingDialogText"
        element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading"
        element-loading-background="rgba(0, 0, 0, 0.2)">
        <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect">
          <el-menu-item index="1">检测任务信息</el-menu-item>
          <el-menu-item index="2">基桩检测信息</el-menu-item>
        </el-menu>
        <!-- 检测任务信息 -->
        <div v-show="activeIndex == '1'" class="dialogBody common" :style="{ height: dialogHeight }">
          <el-form :model="formData" ref="formData">
            <div class="tableRow">
              <el-form-item label="施工标段" prop="fCompanyname" :label-width="formLabelWidth">
                <el-input v-model="formData.fCompanyname" autocomplete="off" placeholder="请选择" disabled></el-input>
              </el-form-item>
              <el-form-item label="工程名称" prop="fProjectname" :label-width="formLabelWidth">
                <el-input v-model="formData.fProjectname" autocomplete="off" placeholder="请选择" disabled></el-input>
              </el-form-item>
            </div>
            <div class="tableRow">
              <el-form-item label="检测项目" prop="fCheckcontent" :label-width="formLabelWidth">
                <el-input v-model="formData.fCheckcontent" autocomplete="off" placeholder="请选择" disabled></el-input>
              </el-form-item>
              <el-form-item label="本次检测基桩数量" prop="fCheckfoundationcount" :label-width="formLabelWidth">
                <el-input v-model="formData.fCheckfoundationcount" autocomplete="off" disabled placeholder="自动填入">
                </el-input>
              </el-form-item>
            </div>
            <div class="tableRow">
              <el-form-item label="报验日期" prop="fInspectiondates" :label-width="formLabelWidth">
                <el-input v-model="formData.fInspectiondates" autocomplete="off" placeholder="请选择" disabled></el-input>
              </el-form-item>
              <el-form-item label="联系人和电话" prop="fContactsandtel" :label-width="formLabelWidth">
                <el-input v-model="formData.fContactsandtel" autocomplete="off" disabled placeholder="请输入"></el-input>
              </el-form-item>
            </div>
            <div class="tableRow">
              <el-form-item label="检测日期" prop="fCheckdates" :label-width="formLabelWidth">
                <el-input v-model="formData.fCheckdates" autocomplete="off" disabled placeholder="请输入"></el-input>
              </el-form-item>
              <el-form-item label="检测人员" prop="fCheckernames" :label-width="formLabelWidth">
                <el-input v-model="formData.fCheckernames" autocomplete="off" disabled placeholder="请选择"></el-input>
              </el-form-item>
            </div>
            <div class="tableRow">
              <el-form-item label="是否为该工程最后一次检测" prop="fIslastcheck" :label-width="formLabelWidth">
                <el-input v-model="formData.fIslastcheck" autocomplete="off" disabled placeholder="请选择"></el-input>
              </el-form-item>

              <el-form-item label="资料附件" :label-width="formLabelWidth" class="enclosure" style="height: 100%">
                <div ref="fCheckfile" style="
                    height: 25px;
                    line-height: 25px;
                    width: 100%;
                    display: flex;
                    border: 1px solid #d1d7e2;
                    border-radius: 5px;
                    margin: 8px 0 2px 0;
                  ">
                  <div v-for="(v, i) in fCheckfileList" :key="i" style="margin: 2px 3px; height: 87%"
                    @click="openPdfs(v)">
                    <img style="max-width: 100%; max-height: 100%" src="@/assets/img/pdf.png" />
                  </div>
                </div>
              </el-form-item>
            </div>
          </el-form>
        </div>
        <!-- 基桩检测信息 -->
        <div v-show="activeIndex == '2'" class="dialogBody common reportSheet jzDialog" :style="{ height: dialogHeight }">
          <el-table ref="multipleTableA" v-loading="loading" element-loading-text="拼命加载中"
            element-loading-spinner="el-icon-loading" element-loading-background="rgba(0, 0, 0, 0.2)"
            @row-click="getRowInfo($event, '1')" :data="formData.pierfoundationList" style="width: 100%" height="100%"
            stripe border highlight-current-row @current-change="rowChange">
            <el-table-column fixed type="index" label="序号" align="center">
            </el-table-column>
            <el-table-column prop="fPiernumber" label="墩台桩号" align="center" width="70">
              <template slot-scope="scope">
                <!--    -->
                <div class="lineBoxhidden">
                  <a href="javascript:;" :title="scope.row.fPiernumber">{{
                    scope.row.fPiernumber
                  }}</a>
                </div>
              </template>
            </el-table-column>
            <el-table-column prop="fPourdates" label="灌注日期" width="90" align="center">
              <template slot-scope="scope">
                <div class="lineBoxhidden">
                  <a href="javascript:;" :title="scope.row.fPourdates">{{
                    scope.row.fPourdates
                  }}</a>
                </div>
              </template>
            </el-table-column>

            <el-table-column prop="fMethod" label="成孔方式" width="95">
              <template slot-scope="scope">
                <div class="lineBoxhidden">
                  <a href="javascript:;" :title="scope.row.fMethod">{{
                    scope.row.fMethod
                  }}</a>
                </div>
              </template>
            </el-table-column>

            <el-table-column prop="fStrengthgrade" label="强度等级" align="center" width="70">
              <template slot-scope="scope">
                <div class="lineBoxhidden">
                  <a href="javascript:;" :title="scope.row.fStrengthgrade">{{
                    scope.row.fStrengthgrade
                  }}</a>
                </div>
              </template>
            </el-table-column>
            <el-table-column prop="fPiertype" label="桩型" width="120">
              <template slot-scope="scope">
                <div class="lineBoxhidden">
                  <a href="javascript:;" :title="scope.row.fPiertype">{{
                    scope.row.fPiertype
                  }}</a>
                </div>
              </template>
            </el-table-column>
            <el-table-column prop="fCheckmethod" align="center" label="检测方法" width="110">
              <template slot-scope="scope">
                <div class="lineBoxhidden">
                  <a href="javascript:;" :title="scope.row.fCheckmethod">{{
                    scope.row.fCheckmethod
                  }}</a>
                </div>
              </template>
            </el-table-column>
            <el-table-column prop="fPiercategory" label="桩类别" align="center" width="60">
              <template slot-scope="scope">
                <div class="lineBoxhidden">
                  <a href="javascript:;" :title="scope.row.fPiercategory">{{
                    scope.row.fPiercategory
                  }}</a>
                </div>
              </template>
            </el-table-column>
            <el-table-column prop="fScenepicfile" label="现场照片" align="center" width="70">
              <template slot-scope="scope">
                <div style="
                    display: flex;
                    height: 100%;
                    align-items: center;
                    flex-shrink: 0;
                  ">
                  <div v-for="(v, index) in scope.row.picsfiles" v-viewer :key="index" style="
                      margin: 2px 3px;
                      display: flex;
                      flex-shrink: 0;
                      align-items: center;
                    ">
                    <img style="
                        max-width: 100%;
                        max-height: 100%;
                        width: 18px;
                        height: 20px;
                      " :src="v.url" />
                  </div>
                </div>
              </template>
            </el-table-column>
            <el-table-column prop="fCheckfile" label="检测资料" align="center" width="70">
              <template slot-scope="scope">
                <div style="
                    display: flex;
                    height: 100%;
                    align-items: center;
                    flex-shrink: 0;
                  ">
                  <div v-for="(v, index) in scope.row.checkfiles" @click="openPdfs(v)" :key="index" style="
                      margin: 2px 3px;
                      display: flex;
                      flex-shrink: 0;
                      align-items: center;
                    ">
                    <img style="
                        max-width: 100%;
                        max-height: 100%;
                        width: 18px;
                        height: 20px;
                      " src="@/assets/img/pdf.png" />
                  </div>
                </div>
              </template>
            </el-table-column>
            <el-table-column prop="fIsexception" label="是否异常" align="center" width="70">
              <template slot-scope="scope">
                <div class="lineBoxhidden">
                  <a href="javascript:;" :title="scope.row.fIsexception">{{
                    scope.row.fIsexception
                  }}</a>
                </div>
              </template>
            </el-table-column>
            <el-table-column prop="fHandlerpicfile" label="处理照片" align="center" width="70">
              <template slot-scope="scope">
                <div style="
                    display: flex;
                    height: 100%;
                    align-items: center;
                    flex-shrink: 0;
                  ">
                  <div v-for="(v, index) in scope.row.handlerfiles" v-viewer :key="index" style="
                      margin: 2px 3px;
                      display: flex;
                      align-items: center;
                      flex-shrink: 0;
                    ">
                    <img style="
                        max-width: 100%;
                        max-height: 100%;
                        width: 18px;
                        height: 20px;
                      " :src="v.url" />
                  </div>
                </div>
              </template>
            </el-table-column>
            <el-table-column prop="fExceptionfile" label="异常资料" align="center" width="70">
              <template slot-scope="scope">
                <div style="
                    display: flex;
                    height: 100%;
                    align-items: center;
                    flex-shrink: 0;
                  ">
                  <div v-for="(v, index) in scope.row.exceptionfiles" @click="openPdfs(v)" :key="index" style="
                      margin: 2px 3px;
                      display: flex;
                      align-items: center;
                      flex-shrink: 0;
                    ">
                    <img style="
                        max-width: 100%;
                        max-height: 100%;
                        width: 18px;
                        height: 20px;
                      " src="@/assets/img/pdf.png" />
                  </div>
                </div>
              </template>
            </el-table-column>
            <el-table-column prop="fExceptioninfo" label="异常说明" align="center" width="77">
              <template slot-scope="scope">
                <div class="lineBoxhidden">
                  <a href="javascript:;" :title="scope.row.fExceptioninfo">{{
                    scope.row.fExceptioninfo
                  }}</a>
                </div>
              </template>
            </el-table-column>
            <template slot="empty">
              <img style="width: 285px; height: 208px" src="@/assets/img/undata.png" alt="" />
              <div class="pageFlagText">暂时没有数据哦！</div>
            </template>
          </el-table>
        </div>
      </el-dialog>
    </div>
    <!-- 新增详情 -->
    <div class="Control-1 zj_new">
      <el-dialog :title="textTitle" v-dialogDrag :visible.sync="dialogTableVisible" v-loading="loadingDialog"
        element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading"
        element-loading-background="rgba(0, 0, 0, 0.2)">
        <div class="dialogBody common jzDialog" :style="{ height: dialogHeightnew }">
          <el-form :model="pierfoundationList" ref="pierfoundationList">
            <div class="tableRow">
              <el-form-item label="墩台桩号" prop="fPiernumber" :label-width="formLabelWidth">
                <el-input v-model="pierfoundationList.fPiernumber" autocomplete="off" placeholder="请输入" disabled>
                </el-input>
              </el-form-item>
              <el-form-item label="灌注日期" prop="fPourdates" :label-width="formLabelWidth">
                <el-input v-model="pierfoundationList.fPourdates" autocomplete="off" placeholder="请输入" disabled>
                </el-input>
              </el-form-item>
            </div>
            <div class="tableRow">
              <el-form-item label="成孔方法" prop="fMethod" :label-width="formLabelWidth">
                <el-input v-model="pierfoundationList.fMethod" autocomplete="off" placeholder="请输入" disabled></el-input>
              </el-form-item>
              <el-form-item label="强度等级" prop="fStrengthgrade" :label-width="formLabelWidth">
                <el-input v-model="pierfoundationList.fStrengthgrade" autocomplete="off" placeholder="请输入" disabled>
                </el-input>
              </el-form-item>
            </div>
            <div class="tableRow">
              <el-form-item label="桩型" prop="fPiertype" :label-width="formLabelWidth">
                <el-input v-model="pierfoundationList.fPiertype" autocomplete="off" placeholder="请输入" disabled>
                </el-input>
              </el-form-item>
              <el-form-item label="检测方法" prop="fCheckmethod" :label-width="formLabelWidth">
                <el-input v-model="pierfoundationList.fCheckmethod" autocomplete="off" placeholder="请输入" disabled>
                </el-input>
              </el-form-item>
            </div>
            <div class="tableRow">
              <el-form-item label="桩类别" prop="fPiercategory" :label-width="formLabelWidth">
                <el-input v-model="pierfoundationList.fPiercategory" autocomplete="off" placeholder="请输入" disabled>
                </el-input>
              </el-form-item>
              <el-form-item label="现场照片" :label-width="formLabelWidth" class="enclosure" style="height: 100%">
                <div style="
                    height: 25px;
                    line-height: 25px;
                    width: 100%;
                    display: flex;
                    border: 1px solid #d1d7e2;
                    border-radius: 5px;
                    margin: 8px 0 2px 0;
                  ">
                  <!-- <div
                      v-for="(v, i) in fScenepicfileList"
                      :key="i"
                      style="margin: 2px 3px; height: 87%"
                      @click="openPdfs(v)"
                      v-viewer
                                                                            > -->
                  <!-- <img
                        :src="v.url"
                        style="height: 90%"
                                                                              /> -->

                  <div v-for="(v, i) in fScenepicfileList" :key="i" style="margin: 2px 3px; height: 87%" v-viewer>
                    <img :src="v.url" alt="" style="height: 90%" />
                  </div>
                </div>
              </el-form-item>
            </div>

            <div class="tableRow">
              <el-form-item label="检测资料" prop="fCheckfile" :label-width="formLabelWidth" class="enclosure"
                style="height: 100%">
                <div style="
                    height: 25px;
                    line-height: 25px;
                    width: 100%;
                    display: flex;
                    border: 1px solid #d1d7e2;
                    border-radius: 5px;
                    margin: 8px 0 2px 0;
                  ">
                  <div v-for="(v, i) in fCheckfilesList" :key="i" style="margin: 2px 3px; height: 87%"
                    @click="openPdfs(v)">
                    <img style="max-width: 100%; max-height: 100%" src="@/assets/img/pdf.png" />
                  </div>
                </div>
              </el-form-item>
              <el-form-item label="是否异常" prop="fIsexception" :label-width="formLabelWidth">
                <el-input v-model="pierfoundationList.fIsexception" placeholder="请输入内容" autocomplete="off" disabled>
                </el-input>
              </el-form-item>
            </div>
            <div class="tableRow" style="margin-top: 10px">
              <el-form-item label="异常说明" prop="fExceptioninfo" :label-width="formLabelWidth">
                <el-input v-model="pierfoundationList.fExceptioninfo" placeholder="请输入内容" autocomplete="off" disabled>
                </el-input>
              </el-form-item>
            </div>
            <div class="tableRow">
              <el-form-item label="处理照片" prop="fHandlerpicfile" :label-width="formLabelWidth" class="enclosure"
                style="height: 100%">
                <el-input v-if="false" v-model="pierfoundationList.fHandlerpicfile" autocomplete="off">
                </el-input>
                <div style="
                    height: 25px;
                    line-height: 25px;
                    width: 100%;
                    display: flex;
                    border: 1px solid #d1d7e2;
                    border-radius: 5px;
                    margin: 8px 0 2px 0;
                  ">
                  <!-- <div
                      v-for="(v, i) in fHandlerpicfileList"
                      :key="i"
                       style="margin: 2px 3px; height: 87%"
                      @click="openPdfs(v)"
                       v-viewer
                                                                            >  -->
                  <!-- <img
                        :src="v.url"
                        style="height: 90%"
                                                                              /> -->

                  <div v-for="(v, i) in fHandlerpicfileList" :key="i" style="margin: 2px 3px; height: 87%" v-viewer>
                    <img :src="v.url" alt="" style="height: 90%" />
                  </div>
                </div>
              </el-form-item>
              <el-form-item label="异常资料" prop="fExceptionfile" :label-width="formLabelWidth" class="enclosure"
                style="height: 100%">
                <el-input v-if="false" v-model="pierfoundationList.fExceptionfile" autocomplete="off">
                </el-input>
                <div style="
                    height: 25px;
                    line-height: 25px;
                    width: 100%;
                    display: flex;
                    border: 1px solid #d1d7e2;
                    border-radius: 5px;
                    margin: 8px 0 2px 0;
                  ">
                  <div v-for="(v, i) in fExceptionfileList" :key="i" style="margin: 2px 3px; height: 87%"
                    @click="openPdfs(v)">
                    <img style="max-width: 100%; max-height: 100%" src="@/assets/img/pdf.png" />
                  </div>
                </div>
              </el-form-item>
            </div>
          </el-form>
        </div>
        <div style="height: 40px">
          <div style="position: absolute; right: 5px; bottom: 0">
            <el-button type="primary" v-show="!see" @click="submitForms(0)">保存</el-button>
          </div>
        </div>
      </el-dialog>
    </div>
    <!-- 附件展示 -->
    <div class="Control-2">
      <el-dialog top="4vh" :title="fFileName" v-dialogDrag :visible.sync="dialogPdf">
        <div :style="{ height: dialogHeighta }">
          <iframe :src="pdfUrl" width="100%" height="100%" frameborder="0"></iframe>
        </div>
      </el-dialog>
    </div>
  </div>
</template>
<script>
import tree from "@/components/public/common-trees";

import {
  getUserCompanyTreeList,
  getPierTaskPageList,
  getPierTaskByFid,
} from "@/api/request.js";
// import {
//   treeData
// } from '@/utils/config';
export default {
  name: "Home",
  data() {
    return {
      names1: "Monitoring",
      yj_view: null,
      // 查看
      dialogTableVisibleText: false,
      loadingDialogText: false,
      activeIndex: "1",
      formData: {},
      dialogHeight: "",
      dialogHeightnew: "",
      formLabelWidth: "160px", //弹框文字部分宽度
      dialogTableVisible: false,
      loadingDialog: false,
      textTitle: "", //详情弹框标题
      fCheckfileList: [],
      fScenepicfileList: [],
      fCheckfilesList: [],
      fHandlerpicfileList: [],
      fExceptionfileList: [],
      pierfoundationList: {},
      // 附件展示
      dialogPdf: false,
      pdfUrl: "",
      fFileName: "",
      dialogHeighta: "",
      // 列表
      getList: {
        modelType: "2", // 0代办 1已办  2查询页面
        fCompanyid: "", // 施工单位id
        fUserid: "", //当前登录用户id
        // 查询页面加上下面参数
        sublevel: "1", //查看下级  1是0否
        page: 1, //页码
        pageSize: 20, //每页条数
      },
      checked: true, //查看下级
      name: "未选择公司",
      loading: false,
      tableData: [],
      // 列表

      // 左侧机构树
      treeData: [],
      defaultProps: {
        children: "children",
        label: "fShortname",
      },
      treeText: {
        companyId: null,
        userId: null,
      },
      treelength: false,
      highlightBd: true, //左侧机构树停留背景色
      // 左侧机构树
      checkData: [], //选中tree状态id
    };
  },
  components: {
    tree,
  },
  created() {
    this.userInfo = JSON.parse(sessionStorage.getItem("yjSmart-userInfo"));
    this.getList.fUserid = this.userInfo.userId;
    this.getList.fCompanyid = this.userInfo.companyId;
  },
  mounted() {
    if (JSON.parse(sessionStorage.getItem("yjSmart-engineerList"))) {
      var id = JSON.parse(sessionStorage.getItem("yjSmart-engineerList"));
      this.checkData = [id.fCompanyid];
    }
    // 获取页面高度
    this.getHeight();
    // 获取列表
    // this.getDataList(this.getList);
    // 左侧机构树
    this.getTree();
    // 按钮权限
    this.btnRole(this.names1);
  },
  methods: {
    // 按钮权限
    btnRole(name) {
      var btnList = [];
      var ModuleList = JSON.parse(sessionStorage.getItem("yjSmart-ModuleList"));
      if (ModuleList.length > 0) {
        ModuleList.map((item) => {
          if (item.fEncode == name) {
            btnList = item.modulebuttonList;
          }
        });
        var btnStr = [];
        btnList.map((item) => {
          btnStr.push(item.fEncode);
        });
        this.yj_view = btnStr.includes("yj_view");
      } else {
        this.yj_view = true;
      }
    },
    //查看下级
    see() {
      if (this.checked == true) {
        this.getList.sublevel = 1;
      } else {
        this.getList.sublevel = 0;
      }
      this.getDataList(this.getList);
    },
    // 点击当前行变色
    rowChange(val) {
      this.currentRow = val;
    },
    // 左侧树结构
    getTree() {
      this.treeText.companyId = this.userInfo.companyId;
      this.treeText.userId = this.userInfo.userId;
      getUserCompanyTreeList(this.treeText)
        .then((res) => {
          if (res.errcode == 0) {
            var companyTree = res.data.userCompanyTreeList;
            this.treeData = this.commonJs.tranListToTreeData(companyTree);

            if (this.treeData[0].children == undefined) {
              this.treelength = false;
            } else {
              this.treelength = true;
            }
            if (this.checkData[0]) {
              this.name = JSON.parse(
                sessionStorage.getItem("yjSmart-engineerList")
              ).fShortname;
              this.getList.fCompanyid = this.checkData[0];
            } else {
              this.name = this.treeData[0].fShortname; //当前点击组织机构名称
              this.getList.fCompanyid = this.treeData[0].fCompanyid; //当前点击组织机构ID
              this.checkData[0] = this.treeData[0].fCompanyid;

            }
            this.getDataList(this.getList);
            // this.name = this.treeData[0].fShortname;
          } else {
            this.$message.error(res.msg);

            return false;
          }
        })
        .catch(() => {
          return false;
        });
    },
    // 遍历树状图

    // 获取列表数据
    getDataList(id) {
      this.loading = true;
      getPierTaskPageList(id)
        .then((res) => {
          if (res.errcode == 0) {
            var that = this;
            that.loading = false;
            that.tableData = res.data.pageInfo.list;
            setTimeout(() => {
              that.$nextTick(() => {
                that.$refs.multipleTable.doLayout();
              });
            }, 200);
          } else {
            this.$message.error("获取列表数据失败", res.msg);
            this.loading = false;
            return false;
          }
        })
        .catch(() => {
          console.log("列表数据接口报错");
          this.loading = false;
        });
    },

    // 点击工程名称
    openDialog(num, row) {
      this.see = true;
      if (num == "0") {
        this.fId = row.F_Id;
        this.editText();
      } else {
        this.textTitle = "查看基桩检测";
        this.dialogTableVisible = true;
        this.pierfoundationList = row;
        this.fScenepicfileList = row.picsfiles; // 现场照片
        this.fHandlerpicfileList = row.handlerfiles; // 处理照片
        this.fCheckfilesList = row.checkfiles; // 检测资料
        this.fExceptionfileList = row.exceptionfiles; // 异常资料
      }
    },
    // 查看
    editText() {
      this.activeIndex = "1";
      if (this.fId != null && this.fId != "") {
        this.dialogText = "查看";
        this.loadingDialogText = true;
        getPierTaskByFid({ fId: this.fId })
          .then((res) => {
            if (res.errcode == 0) {
              var that = this;
              that.loadingDialogText = false;
              that.dialogTableVisibleText = true;
              that.formData = res.data.lrCheckPiertask;
              that.timestamp = res.data.lrCheckPiertask.fCheckfile;
              that.fCheckfileList = res.data.checkFile;
              that.formData.recordfiles = [];
            } else {
              this.$message.error("查看", res.msg);
              this.loadingDialogText = false;
            }
          })
          .catch(() => {
            console.log("查看接口报错");
            this.loadingDialogText = false;
          });
      } else {
        return this.$message.error("请先选择需要查看的数据");
      }
    },
    // 点击当前行
    getRowInfo(e, num) {
      this.fId = "";
      this.row = "";
      if (num == "0") {
        // 列表页当前行
        this.row = e;
        this.fId = e.F_Id;
      } else {
        //弹框内当前行
        this.row = e;
        this.fPiernumber = e.fId;
      }
    },
    // 展示文件
    openPdfs(v) {
      this.dialogPdf = true;
      this.pdfUrl = v.url;
      this.fFileName = v.fFileName;
    },

    // 获取页面容器高度
    getHeight() {
      var h = document.documentElement.clientHeight; //获取页面可见高度
      // var w = document.documentElement.clientWidth; //获取页面可见高度
      this.dialogHeight = h * 0.35 + "px";
      this.dialogHeightnew = h * 0.3 + "px";

      this.dialogHeighta = h * 0.9 + "px";
    },
    // 点击左侧机构树
    handleNodeClick(data) {
      if (this.checked == true) {
        this.getList.sublevel = 1;
      } else {
        this.getList.sublevel = 0;
      }
      this.name = data.fShortname;
      this.getList.fCompanyid = data.fCompanyid;
      this.getDataList(this.getList);
    },

    //点击弹框内侧标题
    handleSelect(key) {
      this.activeIndex = key;
    },
  },
};
</script>
<style scoped>
.printTables {
  background: #fff;
  display: flex;
  justify-content: end;
  padding: 5px;
  margin-top: 10px;
}

.dialogBody {
  padding: 3px 20px;
  height: 80%;
  overflow-y: auto;
}

.mechanism_nav_left {
  display: flex;
  align-items: center;
  width: 60%;
}

.mechanism_nav_left .selectBox {
  display: flex;
  align-items: center;
  /* width: 3.5rem; */
}

.mechanism_nav_left .selectBox .nameBox {
  width: 85px;
  font-size: 0.12rem;
}

.pageFlagText {
  color: #171a1d;
  font-size: 16px;
}

a {
  text-decoration: none;
  color: #000;
}
</style>